package com.newsinfo.pojo;


import com.newsinfo.anno.State;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.time.LocalDateTime;
@Data
public class Article {
    private Integer id;//主键ID
    //@NotEmpty
    @Pattern(regexp = "^\\S{1,10}$",message = "文章标题不能为空")
    private String title;//文章标题
    @NotEmpty(message = "文章内容不能为空")
    private String content;//文章内容
    private String coverImg;//封面图像
    @State
    private String state;//发布状态 已发布|草稿
    @NotNull(message = "未选定文章分类")
    private Integer categoryId;//文章分类id
    private String categoryName;//文章分类名称
    private Integer createUser;//创建人ID
    private LocalDateTime createTime;//创建时间
    private LocalDateTime updateTime;//更新时间
}
